package com.xuelang.pipeline.domain.pipeline.service;

import com.xuelang.pipeline.client.common.result.PageRecord;
import com.xuelang.pipeline.client.pipeline.dto.DeploymentUnitQuery;
import com.xuelang.pipeline.domain.pipeline.DeploymentUnit;

import java.util.List;

/**
 * <p>部署单域服务接口</p>
 *
 * @author : yixin.lys
 * @date : 2024-06-25 16:28
 **/
public interface DeploymentUnitDomainService {

    /**
     * 根据流水线编码分页获取部署单
     *
     * @param currentPage
     * @param pageSize
     * @param condition
     * @return
     */
    PageRecord<DeploymentUnit> pageByCondition(long currentPage, long pageSize, DeploymentUnitQuery condition);


    /**
     * 新增部署单
     *
     * @param deploymentUnit
     */
    void add(DeploymentUnit deploymentUnit);


    /**
     * 更新部署单
     *
     * @param deploymentUnit
     */
    void update(DeploymentUnit deploymentUnit);

    /**
     * 通过流水线实例编码查询部署单详情
     *
     * @param pipelineInstanceCode
     * @return
     */
    DeploymentUnit queryByPipelineInstanceCode(String pipelineInstanceCode);

    /**
     * 根据id批量删除
     *
     * @param idList
     */
    void removeByIds(List<String> idList);

    /**
     * 根据流水线实例code批量删除
     *
     * @param codeList
     */
    void removeByCodes(List<String> codeList);

    /**
     * 根据id查询部署单详情
     *
     * @param id
     * @return
     */

    DeploymentUnit queryById(String id);

}
